package com.happy.seatwork;

public class Narcissistic_number {
    public static void main(String args[]){
        int num;
        int x, y, z, i = 0;
        for (num = 100; num < 1000; num++){
            x = num % 10;
            y = num / 10 % 10;
            z = num / 100;
            if (num == (x * x * x) + (y * y * y) + (z * z * z)){
                System.out.printf("%d ", num);
                i++;
                if (i % 10 == 0) {
                    System.out.printf("\n");
                }
            }
        }

    }
}
